package com.xw.comm.entity.run;

/**
 * 基本的一些状态
 *
 * @author ：xiongwei
 * @date ：Created in 2021/9/25 21:36
 */
public enum BaseStateEnum {

    /**
     * 战斗状态或者非战斗状态
     */
    FIGHT("战斗", 1),
    NON_COMBAT("非战斗", 2);

    private String name;
    private int index;

    BaseStateEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }

    public static String getBaseState(int index) {
        for (BaseStateEnum state : BaseStateEnum.values()) {
            if (state.getIndex() == index) {
                return state.getName();
            }
        }
        return NON_COMBAT.getName();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

}
